<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
	<p:messages autoUpdate="true" />
	<h:form>
		<h:panelGrid columns="3" style="margin-bottom:10px" cellpadding="5">
			<!-- 			//TODO: csak akkor lehessen megnyomni, ha a minden ki van tölve -->
			<p:commandButton process="@form" value="Ajánlat nyomtatása" action="#{customerMaintBean.printOffer()}" update="values :form:panel :display" disabled="#{customerMaintBean.loanApplication.status > 0}" id="ajaxPrintOffer" />
			<!-- 			//TODO: csak akkor lehessen megnyomni, ha a minden ki van tölve + ajánlat nyomtatva -->
			<p:commandButton process="@form" value="Szerződés nyomtatása" action="#{customerMaintBean.printContract()}" update="values :form:panel :display" rendered="#{customerMaintBean.loanApplication.status gt 0}" id="ajaxPrintContract"
				disabled="#{customerMaintBean.loanApplication.status gt 1}" />
			<!-- 			//TODO: csak akkor lehessen megnyomni, ha a loanApplication.isApproved = true -->
			<p:commandButton process="@form" value="Szerződés aláírása" action="#{customerMaintBean.signContract()}" update="values :form:panel :display" rendered="#{customerMaintBean.loanApplication.status gt 0}" id="ajaxSignContract"
				disabled="#{customerMaintBean.loanApplication.status gt 1}" />
		</h:panelGrid>
		<p:fieldset id="values">
			<h:panelGrid columns="2">
				<p:outputLabel value="Minimumkiértékelésen megfelelt" />
				<p:graphicImage rendered="#{customerMaintBean.loanApplication.isMinimumConditionApproved}" library="img" name="approved_2.png" />
				<p:graphicImage rendered="#{!customerMaintBean.loanApplication.isMinimumConditionApproved}" library="img" name="disapproved_2.png" />

				<p:outputLabel value="Ajánlat adható" />
				<p:graphicImage rendered="#{customerMaintBean.loanApplication.isOfferApproved}" library="img" name="approved_2.png" />
				<p:graphicImage rendered="#{!customerMaintBean.loanApplication.isOfferApproved}" library="img" name="disapproved_2.png" />

				<p:outputLabel value="Ajánlat nyomtatva" />
				<p:graphicImage rendered="#{customerMaintBean.loanApplication.isOfferPrinted}" library="img" name="approved_2.png" />
				<p:graphicImage rendered="#{!customerMaintBean.loanApplication.isOfferPrinted}" library="img" name="disapproved_2.png" />

				<p:outputLabel rendered="#{customerMaintBean.loanApplication.status > 0}" value="Igénylés adható" />
				<p:graphicImage rendered="#{customerMaintBean.loanApplication.isApplicationApproved and customerMaintBean.loanApplication.status > 0}" library="img" name="approved_2.png" />
				<p:graphicImage rendered="#{!customerMaintBean.loanApplication.isApplicationApproved and customerMaintBean.loanApplication.status > 0}" library="img" name="disapproved_2.png" />

				<p:outputLabel rendered="#{customerMaintBean.loanApplication.status > 0}" value="Szerződés nyomtatva" />
				<p:graphicImage rendered="#{customerMaintBean.loanApplication.isContractPrinted and customerMaintBean.loanApplication.status > 0}" library="img" name="approved_2.png" />
				<p:graphicImage rendered="#{!customerMaintBean.loanApplication.isContractPrinted and customerMaintBean.loanApplication.status > 0}" library="img" name="disapproved_2.png" />

				<p:outputLabel rendered="#{customerMaintBean.loanApplication.status > 0}" value="Szerződés aláírva" />
				<p:graphicImage rendered="#{customerMaintBean.loanApplication.isContractSigned and customerMaintBean.loanApplication.status > 0}" library="img" name="approved_2.png" />
				<p:graphicImage rendered="#{!customerMaintBean.loanApplication.isContractSigned and customerMaintBean.loanApplication.status > 0}" library="img" name="disapproved_2.png" />
			</h:panelGrid>
		</p:fieldset>
	</h:form>
</ui:composition>